{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [],
   "source": [
    "import numpy as np"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[ 52,  91,  79],\n",
       "       [  1,  12,  96],\n",
       "       [ 46,  82,  51],\n",
       "       [  1, 100,  25],\n",
       "       [ 53,  49,  73],\n",
       "       [ 25,  82,  31],\n",
       "       [ 42,  28,  28],\n",
       "       [ 94,  96,  77],\n",
       "       [ 96,  39,  74],\n",
       "       [ 18,  30,  59],\n",
       "       [ 10,  33,  71],\n",
       "       [ 43,  54,  16],\n",
       "       [ 77,  96,  30],\n",
       "       [ 42,  22,  57],\n",
       "       [ 66,   7,  58],\n",
       "       [ 40,  18,  83],\n",
       "       [  6,   1,  81],\n",
       "       [ 24,  26,  33],\n",
       "       [ 44,   4,  54],\n",
       "       [ 95,  68,  78],\n",
       "       [ 45,  68,  83],\n",
       "       [ 96,   0,   2],\n",
       "       [ 16,  35,   1],\n",
       "       [ 42,  52,   9],\n",
       "       [ 27,  79,  92],\n",
       "       [ 55,  81,  66],\n",
       "       [ 63,  28,  84],\n",
       "       [ 10,  10,   3],\n",
       "       [ 70,  36,  94],\n",
       "       [ 16,  91,  29],\n",
       "       [ 94,  47,  76],\n",
       "       [ 70,  91,  21],\n",
       "       [ 56,   2,  27],\n",
       "       [ 12, 100,  15],\n",
       "       [ 95,  96,  76],\n",
       "       [ 53,  80,  35],\n",
       "       [ 17,  30,  13],\n",
       "       [ 76,  80,  85],\n",
       "       [ 85,  64,  31],\n",
       "       [ 12,  48,  26],\n",
       "       [ 40,  27,  48],\n",
       "       [ 16,  92,  39],\n",
       "       [ 17,  76,  19],\n",
       "       [ 39,  91,  34],\n",
       "       [ 98,  98,  39],\n",
       "       [ 50,  13,  79],\n",
       "       [ 67,  43,  61],\n",
       "       [ 30,   5,  76],\n",
       "       [ 66,  55,  70],\n",
       "       [ 42,  15,  33]])"
      ]
     },
     "execution_count": 10,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "class1 = np.random.randint(0,101,size = (50,3))\n",
    "class2 = np.random.randint(0,101,size = (50,3))\n",
    "class3 = np.random.randint(0,101,size = (50,3))\n",
    "class4 = np.random.randint(0,101,size = (50,3))\n",
    "class5 = np.random.randint(0,101,size = (50,3))\n",
    "class6 = np.random.randint(0,101,size = (50,3))\n",
    "\n",
    "class1"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[ 52,  91,  79],\n",
       "       [  1,  12,  96],\n",
       "       [ 46,  82,  51],\n",
       "       [  1, 100,  25],\n",
       "       [ 53,  49,  73],\n",
       "       [ 25,  82,  31],\n",
       "       [ 42,  28,  28],\n",
       "       [ 94,  96,  77],\n",
       "       [ 96,  39,  74],\n",
       "       [ 18,  30,  59],\n",
       "       [ 10,  33,  71],\n",
       "       [ 43,  54,  16],\n",
       "       [ 77,  96,  30],\n",
       "       [ 42,  22,  57],\n",
       "       [ 66,   7,  58],\n",
       "       [ 40,  18,  83],\n",
       "       [  6,   1,  81],\n",
       "       [ 24,  26,  33],\n",
       "       [ 44,   4,  54],\n",
       "       [ 95,  68,  78],\n",
       "       [ 45,  68,  83],\n",
       "       [ 96,   0,   2],\n",
       "       [ 16,  35,   1],\n",
       "       [ 42,  52,   9],\n",
       "       [ 27,  79,  92],\n",
       "       [ 55,  81,  66],\n",
       "       [ 63,  28,  84],\n",
       "       [ 10,  10,   3],\n",
       "       [ 70,  36,  94],\n",
       "       [ 16,  91,  29],\n",
       "       [ 94,  47,  76],\n",
       "       [ 70,  91,  21],\n",
       "       [ 56,   2,  27],\n",
       "       [ 12, 100,  15],\n",
       "       [ 95,  96,  76],\n",
       "       [ 53,  80,  35],\n",
       "       [ 17,  30,  13],\n",
       "       [ 76,  80,  85],\n",
       "       [ 85,  64,  31],\n",
       "       [ 12,  48,  26],\n",
       "       [ 40,  27,  48],\n",
       "       [ 16,  92,  39],\n",
       "       [ 17,  76,  19],\n",
       "       [ 39,  91,  34],\n",
       "       [ 98,  98,  39],\n",
       "       [ 50,  13,  79],\n",
       "       [ 67,  43,  61],\n",
       "       [ 30,   5,  76],\n",
       "       [ 66,  55,  70],\n",
       "       [ 42,  15,  33],\n",
       "       [  4,  46,  63],\n",
       "       [ 82,  51,  61],\n",
       "       [ 74,  98,  79],\n",
       "       [ 93,  37,  88],\n",
       "       [ 53,  86,  64],\n",
       "       [ 49,  45,  26],\n",
       "       [ 91,   9,  21],\n",
       "       [ 51,  89,  52],\n",
       "       [ 99,  97,  85],\n",
       "       [  1,  31,  32],\n",
       "       [ 63,  17,  48],\n",
       "       [ 41,  79,  55],\n",
       "       [ 15,  46,  12],\n",
       "       [ 90,  89,  60],\n",
       "       [ 61,  34,  17],\n",
       "       [ 48,  99,  93],\n",
       "       [ 95,  14,   4],\n",
       "       [ 65,  16,  48],\n",
       "       [100,  54,  61],\n",
       "       [ 23,   3,  42],\n",
       "       [ 56,  39,  69],\n",
       "       [ 93,  20,  66],\n",
       "       [ 65,  25,  96],\n",
       "       [ 63,   4,  75],\n",
       "       [ 20,  37,  28],\n",
       "       [ 83,   6,  40],\n",
       "       [ 70,  45,  98],\n",
       "       [ 39,  42,  47],\n",
       "       [ 38,  23,  99],\n",
       "       [ 39,  89,  22],\n",
       "       [ 79,  32,  21],\n",
       "       [ 38,   7,  27],\n",
       "       [  2,  18,  59],\n",
       "       [ 30,   6,  51],\n",
       "       [ 73,  30,  25],\n",
       "       [ 14,   0,   1],\n",
       "       [ 56,  20,  97],\n",
       "       [ 99,  56,  20],\n",
       "       [ 88,  30,  84],\n",
       "       [ 69,  44,   2],\n",
       "       [ 99,  92,  87],\n",
       "       [ 24,  22,  83],\n",
       "       [ 38,  70,  58],\n",
       "       [ 45,  62,  34],\n",
       "       [ 29,  20,  75],\n",
       "       [ 60,  42,  61],\n",
       "       [ 44,  14,  75],\n",
       "       [ 86,  92,  68],\n",
       "       [ 95,   3,  32],\n",
       "       [  8,  10,  61],\n",
       "       [ 66,  33,  88],\n",
       "       [ 83,  17,  59],\n",
       "       [ 60,  61,   1],\n",
       "       [ 18,  98,  59],\n",
       "       [ 35,  56,  92],\n",
       "       [ 63,  72,  45],\n",
       "       [ 58,  71,  95],\n",
       "       [ 95,  72,  83],\n",
       "       [ 82,  75,  56],\n",
       "       [ 64,  95,  43],\n",
       "       [ 42,  18,  14],\n",
       "       [ 65,  12,  41],\n",
       "       [  4,  15,  40],\n",
       "       [ 59,  30,  98],\n",
       "       [ 87,  37,  96],\n",
       "       [ 53,  41,  79],\n",
       "       [ 17,  21,  20],\n",
       "       [ 26,  94,  75],\n",
       "       [ 85,  71,  88],\n",
       "       [ 24,  57,  31],\n",
       "       [ 96,  38,  18],\n",
       "       [ 97,  47,  13],\n",
       "       [ 77,   3,  24],\n",
       "       [ 53,   2,  63],\n",
       "       [ 20,  45,  88],\n",
       "       [ 76,  97,  60],\n",
       "       [ 41,  66,  35],\n",
       "       [ 91,  72,  11],\n",
       "       [  9,  97,  32],\n",
       "       [ 86,  44,  22],\n",
       "       [  9,  16,  16],\n",
       "       [  4,  75,  41],\n",
       "       [ 68,  45,  14],\n",
       "       [ 96,  88,   3],\n",
       "       [ 95,  78,  55],\n",
       "       [ 45,  98,  83],\n",
       "       [ 51,  34,  71],\n",
       "       [ 62,  50,  76],\n",
       "       [ 35,  50,  99],\n",
       "       [ 79,  27,  14],\n",
       "       [ 32,  65,  30],\n",
       "       [ 30,  17,  53],\n",
       "       [ 12,   3,  32],\n",
       "       [ 44,  96,  60],\n",
       "       [ 63,  76,  89],\n",
       "       [ 76,  88,  56],\n",
       "       [ 85,  53,  36],\n",
       "       [ 13,  51,  99],\n",
       "       [ 69,  24,  30],\n",
       "       [ 95,  47,  79],\n",
       "       [ 70,   1,  70],\n",
       "       [ 12,  55,  87],\n",
       "       [ 82,  89,  94],\n",
       "       [  3,  34,  59],\n",
       "       [ 88,  35,  46],\n",
       "       [  1,  82,  71],\n",
       "       [ 37,  10,   9],\n",
       "       [ 84,  28,  41],\n",
       "       [ 88,   0,  38],\n",
       "       [ 16,  27,  44],\n",
       "       [ 75,  26,  60],\n",
       "       [ 78,  29,  75],\n",
       "       [ 81,  85,  45],\n",
       "       [ 88,  16,   0],\n",
       "       [ 39,  21,  21],\n",
       "       [ 30,  61,  67],\n",
       "       [ 26,  48,  57],\n",
       "       [ 55,  12,  60],\n",
       "       [ 69,  64,  75],\n",
       "       [ 91,  22,  34],\n",
       "       [ 51,  42,  97],\n",
       "       [ 30,  80,  34],\n",
       "       [ 19,  66,  29],\n",
       "       [ 17,  59,   3],\n",
       "       [ 67,  53,  25],\n",
       "       [ 88,  26,  62],\n",
       "       [ 27,  52,  12],\n",
       "       [ 31,  31,  30],\n",
       "       [ 49,  19,  64],\n",
       "       [ 99,  49,  37],\n",
       "       [ 46,  43,  90],\n",
       "       [ 87,  96,  84],\n",
       "       [  0,  34,  39],\n",
       "       [ 75,  35,   5],\n",
       "       [ 39,  71,  21],\n",
       "       [  8,  78,  15],\n",
       "       [ 50,  29,  54],\n",
       "       [ 80,  70,  12],\n",
       "       [ 41,  83,   1],\n",
       "       [ 12,  60,  91],\n",
       "       [  1,  63,  35],\n",
       "       [ 15,  46,  80],\n",
       "       [ 37,  49,  89],\n",
       "       [ 22,  20,  81],\n",
       "       [ 33,  72,  27],\n",
       "       [ 26,  64,  24],\n",
       "       [  1,   2,  53],\n",
       "       [ 15,  15,  61],\n",
       "       [  9,   2,  17],\n",
       "       [ 70,  31,  51],\n",
       "       [ 45,  21,  26],\n",
       "       [ 45,  37,  57],\n",
       "       [ 29,  71,  75],\n",
       "       [ 31,  95,  56],\n",
       "       [ 99,  98,  67],\n",
       "       [ 54,  66,  95],\n",
       "       [ 38,  88,  51],\n",
       "       [ 13,  72,  40],\n",
       "       [ 46,  65,   9],\n",
       "       [ 78,  66,  73],\n",
       "       [ 81,  42,  99],\n",
       "       [ 37,  26,  39],\n",
       "       [ 35,  32,  28],\n",
       "       [ 85,  36,   8],\n",
       "       [ 53,  74,  49],\n",
       "       [ 84,   1,  16],\n",
       "       [ 61,  91,  87],\n",
       "       [ 69,  41,  67],\n",
       "       [ 50,  25,  75],\n",
       "       [ 31,  67,   3],\n",
       "       [ 96,   3,  39],\n",
       "       [ 92,  38,  61],\n",
       "       [ 50,  28,  90],\n",
       "       [ 85,  44,  54],\n",
       "       [ 63,  34,  14],\n",
       "       [ 63,   3,  32],\n",
       "       [ 88,   1,  92],\n",
       "       [ 94,  42,  82],\n",
       "       [ 65,  77,  67],\n",
       "       [ 76,  29,  19],\n",
       "       [ 17,  74,  57],\n",
       "       [ 52,  40,  45],\n",
       "       [ 67,  65,  65],\n",
       "       [ 89,  51,  78],\n",
       "       [ 44,   2,  57],\n",
       "       [ 81,  48, 100],\n",
       "       [ 84,   6,  25],\n",
       "       [ 73,  32,  75],\n",
       "       [ 54,  87,  25],\n",
       "       [ 88,  94,  68],\n",
       "       [ 39,  46,  25],\n",
       "       [ 68,  34,  76],\n",
       "       [ 75,  94,  66],\n",
       "       [ 80,  64,   6],\n",
       "       [ 11,  92,  37],\n",
       "       [ 60,  12,   5],\n",
       "       [ 23,  33,  25],\n",
       "       [ 68,  37,  15],\n",
       "       [  1,  15,  70],\n",
       "       [ 61, 100,  64],\n",
       "       [ 76,  85,  26],\n",
       "       [ 48,  91,  41],\n",
       "       [ 35,  67,  66],\n",
       "       [ 78,  73,  39],\n",
       "       [ 49,  66,   2],\n",
       "       [ 41,  85,  30],\n",
       "       [ 14,  65,  58],\n",
       "       [  7,  13,  55],\n",
       "       [ 90,  86,  17],\n",
       "       [ 10,  78,  68],\n",
       "       [ 46,  98,  84],\n",
       "       [  5,  34,  30],\n",
       "       [ 95,  73,  97],\n",
       "       [ 40,   0,  83],\n",
       "       [ 67,  71,  99],\n",
       "       [ 21,  24,  39],\n",
       "       [ 65,  24,  83],\n",
       "       [ 20,  32,  20],\n",
       "       [ 57,  85,  41],\n",
       "       [ 19,  38,  77],\n",
       "       [ 52,  56,  44],\n",
       "       [ 32,  67,  57],\n",
       "       [ 43,  35,  29],\n",
       "       [ 16,  68,  79],\n",
       "       [ 15,  68,  40],\n",
       "       [ 65,  85,  14],\n",
       "       [ 93,  57,  38],\n",
       "       [ 93,  68,  41],\n",
       "       [ 43,  32,  83],\n",
       "       [  2,  61,  26],\n",
       "       [ 81,  25,  66],\n",
       "       [ 32,  36,  55],\n",
       "       [ 68,  15,  89],\n",
       "       [ 62,  32,  80],\n",
       "       [ 43,  93,  46],\n",
       "       [ 19,  62,   7],\n",
       "       [ 21,  81,   4],\n",
       "       [  6,  26,  37],\n",
       "       [ 23,  60,  13],\n",
       "       [ 41,  11,  25],\n",
       "       [ 89,  96,  53],\n",
       "       [ 29,  16,  66],\n",
       "       [ 36,  78,  43],\n",
       "       [ 23,  56,  44],\n",
       "       [ 49,  17,  65],\n",
       "       [100,  68,   7],\n",
       "       [ 24,   5,  84],\n",
       "       [ 38,  31,  56],\n",
       "       [ 46,   4,  53],\n",
       "       [ 44,  30,  13]])"
      ]
     },
     "execution_count": 11,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "score = np.concatenate((class1,class2,class3,class4,class5,class6),axis = 0)\n",
    "score"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[0],\n",
       "       [0],\n",
       "       [1],\n",
       "       [0],\n",
       "       [1],\n",
       "       [1],\n",
       "       [0],\n",
       "       [0],\n",
       "       [0],\n",
       "       [1],\n",
       "       [0],\n",
       "       [0],\n",
       "       [1],\n",
       "       [1],\n",
       "       [0],\n",
       "       [1],\n",
       "       [1],\n",
       "       [1],\n",
       "       [1],\n",
       "       [1],\n",
       "       [0],\n",
       "       [1],\n",
       "       [0],\n",
       "       [0],\n",
       "       [0],\n",
       "       [1],\n",
       "       [1],\n",
       "       [0],\n",
       "       [0],\n",
       "       [0],\n",
       "       [0],\n",
       "       [0],\n",
       "       [1],\n",
       "       [1],\n",
       "       [1],\n",
       "       [0],\n",
       "       [0],\n",
       "       [0],\n",
       "       [1],\n",
       "       [0],\n",
       "       [0],\n",
       "       [0],\n",
       "       [1],\n",
       "       [0],\n",
       "       [1],\n",
       "       [0],\n",
       "       [1],\n",
       "       [0],\n",
       "       [1],\n",
       "       [0],\n",
       "       [0],\n",
       "       [0],\n",
       "       [1],\n",
       "       [0],\n",
       "       [1],\n",
       "       [1],\n",
       "       [1],\n",
       "       [0],\n",
       "       [0],\n",
       "       [0],\n",
       "       [0],\n",
       "       [1],\n",
       "       [1],\n",
       "       [1],\n",
       "       [1],\n",
       "       [0],\n",
       "       [1],\n",
       "       [1],\n",
       "       [1],\n",
       "       [0],\n",
       "       [0],\n",
       "       [0],\n",
       "       [1],\n",
       "       [1],\n",
       "       [0],\n",
       "       [0],\n",
       "       [0],\n",
       "       [1],\n",
       "       [0],\n",
       "       [0],\n",
       "       [1],\n",
       "       [1],\n",
       "       [1],\n",
       "       [1],\n",
       "       [0],\n",
       "       [1],\n",
       "       [0],\n",
       "       [1],\n",
       "       [1],\n",
       "       [0],\n",
       "       [1],\n",
       "       [0],\n",
       "       [0],\n",
       "       [0],\n",
       "       [1],\n",
       "       [1],\n",
       "       [1],\n",
       "       [0],\n",
       "       [0],\n",
       "       [1],\n",
       "       [0],\n",
       "       [1],\n",
       "       [0],\n",
       "       [1],\n",
       "       [0],\n",
       "       [0],\n",
       "       [1],\n",
       "       [0],\n",
       "       [1],\n",
       "       [0],\n",
       "       [1],\n",
       "       [0],\n",
       "       [1],\n",
       "       [1],\n",
       "       [1],\n",
       "       [1],\n",
       "       [0],\n",
       "       [1],\n",
       "       [0],\n",
       "       [1],\n",
       "       [0],\n",
       "       [0],\n",
       "       [1],\n",
       "       [1],\n",
       "       [0],\n",
       "       [1],\n",
       "       [0],\n",
       "       [0],\n",
       "       [1],\n",
       "       [0],\n",
       "       [1],\n",
       "       [1],\n",
       "       [0],\n",
       "       [1],\n",
       "       [0],\n",
       "       [1],\n",
       "       [1],\n",
       "       [1],\n",
       "       [1],\n",
       "       [0],\n",
       "       [1],\n",
       "       [1],\n",
       "       [1],\n",
       "       [0],\n",
       "       [0],\n",
       "       [1],\n",
       "       [0],\n",
       "       [1],\n",
       "       [0],\n",
       "       [0],\n",
       "       [0],\n",
       "       [0],\n",
       "       [0],\n",
       "       [1],\n",
       "       [0],\n",
       "       [1],\n",
       "       [0],\n",
       "       [1],\n",
       "       [0],\n",
       "       [0],\n",
       "       [0],\n",
       "       [1],\n",
       "       [1],\n",
       "       [0],\n",
       "       [1],\n",
       "       [1],\n",
       "       [1],\n",
       "       [0],\n",
       "       [0],\n",
       "       [1],\n",
       "       [0],\n",
       "       [0],\n",
       "       [0],\n",
       "       [1],\n",
       "       [1],\n",
       "       [0],\n",
       "       [1],\n",
       "       [1],\n",
       "       [1],\n",
       "       [0],\n",
       "       [1],\n",
       "       [1],\n",
       "       [1],\n",
       "       [0],\n",
       "       [1],\n",
       "       [0],\n",
       "       [0],\n",
       "       [0],\n",
       "       [1],\n",
       "       [0],\n",
       "       [1],\n",
       "       [1],\n",
       "       [1],\n",
       "       [1],\n",
       "       [0],\n",
       "       [1],\n",
       "       [0],\n",
       "       [0],\n",
       "       [0],\n",
       "       [1],\n",
       "       [1],\n",
       "       [1],\n",
       "       [1],\n",
       "       [1],\n",
       "       [1],\n",
       "       [0],\n",
       "       [1],\n",
       "       [0],\n",
       "       [0],\n",
       "       [0],\n",
       "       [0],\n",
       "       [0],\n",
       "       [0],\n",
       "       [1],\n",
       "       [0],\n",
       "       [1],\n",
       "       [1],\n",
       "       [1],\n",
       "       [0],\n",
       "       [1],\n",
       "       [0],\n",
       "       [0],\n",
       "       [0],\n",
       "       [1],\n",
       "       [0],\n",
       "       [0],\n",
       "       [0],\n",
       "       [1],\n",
       "       [0],\n",
       "       [0],\n",
       "       [1],\n",
       "       [1],\n",
       "       [0],\n",
       "       [0],\n",
       "       [0],\n",
       "       [1],\n",
       "       [1],\n",
       "       [1],\n",
       "       [0],\n",
       "       [1],\n",
       "       [1],\n",
       "       [1],\n",
       "       [1],\n",
       "       [0],\n",
       "       [1],\n",
       "       [0],\n",
       "       [1],\n",
       "       [0],\n",
       "       [0],\n",
       "       [1],\n",
       "       [0],\n",
       "       [0],\n",
       "       [1],\n",
       "       [0],\n",
       "       [1],\n",
       "       [1],\n",
       "       [1],\n",
       "       [1],\n",
       "       [1],\n",
       "       [1],\n",
       "       [0],\n",
       "       [0],\n",
       "       [1],\n",
       "       [0],\n",
       "       [0],\n",
       "       [0],\n",
       "       [0],\n",
       "       [0],\n",
       "       [1],\n",
       "       [1],\n",
       "       [0],\n",
       "       [1],\n",
       "       [1],\n",
       "       [0],\n",
       "       [0],\n",
       "       [0],\n",
       "       [1],\n",
       "       [0],\n",
       "       [1],\n",
       "       [0],\n",
       "       [1],\n",
       "       [1],\n",
       "       [1],\n",
       "       [0],\n",
       "       [1],\n",
       "       [0],\n",
       "       [0],\n",
       "       [1],\n",
       "       [0],\n",
       "       [0],\n",
       "       [0],\n",
       "       [0],\n",
       "       [0],\n",
       "       [1],\n",
       "       [1],\n",
       "       [0],\n",
       "       [0],\n",
       "       [0],\n",
       "       [1],\n",
       "       [0]])"
      ]
     },
     "execution_count": 18,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "sex = np.random.randint(0,2,300)\n",
    "sex_T = sex.reshape(300,1)\n",
    "sex_T"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 21,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[ 0, 52, 91, 79],\n",
       "       [ 0,  1, 12, 96],\n",
       "       [ 1, 46, 82, 51],\n",
       "       ...,\n",
       "       [ 0, 38, 31, 56],\n",
       "       [ 1, 46,  4, 53],\n",
       "       [ 0, 44, 30, 13]])"
      ]
     },
     "execution_count": 21,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "data = np.hstack((sex_T,score))\n",
    "data"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 65,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "   性别   \t   科目   \t  最低分   \t  最高分   \t  平均分   \t  中位数   \t  标准差   \n",
      " fmale  \t python \t   1    \t  100   \t   52   \t   53   \t   28   \n",
      " fmale  \t  math  \t   0    \t  100   \t   47   \t   45   \t   28   \n",
      " fmale  \t  math  \t   0    \t   99   \t   49   \t   44   \t   29   \n"
     ]
    }
   ],
   "source": [
    "# 找出性别为女性的索引行\n",
    "index_male = np.where(data[:,0]==0)\n",
    "# 找出女性同学的Python成绩\n",
    "male_python = data[index_male,1]\n",
    "male_python_min = np.min(male_python)\n",
    "male_python_max = np.max(male_python)\n",
    "male_python_mean = np.mean(male_python)\n",
    "male_python_median= np.median(male_python)\n",
    "male_python_std= np.std(male_python)\n",
    "#找出女性同学的数学成绩\n",
    "male_math = data[index_male,2]\n",
    "male_math_min = np.min(male_math)\n",
    "male_math_max = np.max(male_math)\n",
    "male_math_mean = np.mean(male_math)\n",
    "male_math_median= np.median(male_math)\n",
    "male_math_std= np.std(male_math)\n",
    "#找出女性同学的语文成绩\n",
    "male_chinese = data[index_male,3]\n",
    "male_chinese_min = np.min(male_chinese)\n",
    "male_chinese_max = np.max(male_chinese)\n",
    "male_chinese_mean = np.mean(male_chinese)\n",
    "male_chinese_median= np.median(male_chinese)\n",
    "male_chinese_std= np.std(male_chinese)\n",
    "#打印结果\n",
    "tplt = \"{0:^8}\\t{1:^8}\\t{2:^8}\\t{3:^8}\\t{4:^8}\\t{5:^8}\\t{6:^8}\"\n",
    "print(tplt.format('性别','科目','最低分','最高分','平均分','中位数','标准差',chr(12288)))\n",
    "print(tplt.format('fmale','python',int(male_python_min),int(male_python_max),int(male_python_mean),int(male_python_median),int(male_python_std),chr(12288)))\n",
    "print(tplt.format('fmale','math',int(male_math_min),int(male_math_max),int(male_math_mean),int(male_math_median),int(male_math_std),chr(12288)))\n",
    "print(tplt.format('fmale','math',int(male_chinese_min),int(male_chinese_max),int(male_chinese_mean),int(male_chinese_median),int(male_chinese_std),chr(12288)))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.6"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 4
}
